package com.lagou.base;

import com.alibaba.fastjson.JSONObject;

public enum Statuscode {

    SUCCESS("success", 1),
    FAIL("fail", 0);
    private String message;
    private int code;


    Statuscode() {
    }

    ;

    Statuscode(String message, int code) {
        this.message = message;
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String toString() {
        JSONObject jo = new JSONObject();
        jo.put("msg",message);//{msg：‘success’，status：1}
        jo.put("status",code);

        return jo.toString();
    }
}